﻿
namespace Pretext {
    /// <summary>
    /// Class that represents a Token currently being watched by the Tokenizer.
    /// </summary>
    public class TokenWatcherItem {

        /// <summary>
        /// Constructs an instance of the TokenWatcherItem with the specified <paramref name="token"/> being watched.
        /// </summary>
        /// <param name="token">A string of the token to watch.</param>
        public TokenWatcherItem(string token) {
            this.Token = token;
            this.PositionValidated = -1;
        }

        /// <summary>
        /// A string representing the Token being watched.
        /// </summary>
        public string Token { get; private set; }

        /// <summary>
        /// The position in the token that has been successfully matched by the Tokenizer.
        /// </summary>
        public int PositionValidated { get; private set; }

        /// <summary>
        /// Increases the PositionValidated indicating that another character has been matched in this token.
        /// </summary>
        public void IncreaseValidatedPosition() {
            this.PositionValidated++;
        }

    }
}